const { ccclass, property } = cc._decorator;

@ccclass
export default class UpgradeControl extends cc.Component {
    @property(cc.Label)
    label: cc.Label = null;
    Exp: number = 0;
    id: string = "";
    SetExp(id: string, exp: number) {
        this.Exp = exp;
        this.id = id;
        this.label.string = exp.toString();
    }
    Upgrade() {
        let Upgrade = new cc.Event.EventCustom('Upgrade', true);
        Upgrade.setUserData(this.id);
        this.node.dispatchEvent(Upgrade);
    }
}
